/*
 *  $Id: Magmaria.cs 1051 2010-05-18 22:10:41Z thenn.erannor $
 *	This file is a part of Ragima CCG.
 *	(C) 2008 Ragima development group.
 *
 *	Licensed under the terms of the GNU GPL License version 2.
 *
 */

namespace Ragima.Cards001.Fire.Lands {
    public class Magmaria: LandCard {
        public Magmaria(): base("001_f_l_magmaria") {
            Level = CompleteLevel.Final;
            Element = ElementType.Fire;
            Value = 100;
            AddManaCost(ElementType.Fire, 4);
        }
        public override void SetNaturalAffects(ICollector<Affect> affects) {
            affects.Add(new Affects.ManaIncome(ElementType.Fire, 3));
            affects.Add<MagmariaAffect>();
        }

        private class MagmariaAffect: Affect {
            public override string Id {
                get { return AffectManager.GetCardId<Magmaria>(null); }
            }

            public override void SetAffect() {
                base.SetAffect();
                GlobalSummary.OnOffenceReady += DoMagmaria;
                GlobalSummary.OnDefenceReady += DoMagmaria;
                EnemySummary.OnOffenceReady += DoMagmaria;
                EnemySummary.OnDefenceReady += DoMagmaria;
            }
            public override void ResetAffect() {
                base.ResetAffect();
                GlobalSummary.OnOffenceReady -= DoMagmaria;
                GlobalSummary.OnDefenceReady -= DoMagmaria;
                EnemySummary.OnOffenceReady -= DoMagmaria;
                EnemySummary.OnDefenceReady -= DoMagmaria;
            }

            private void DoMagmaria(Creature creature) {
                creature.DamageBy(NewDamage(DamageType.MagicAttack,1));
            }
        }
    }
}
